<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>   
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 
    <style>
    	.omission{
    		overflow: hidden;/*内容超出后隐藏*/
    		text-overflow: ellipsis; /*超出显示省略号*/
    		white-space: nowrap;/*文本不进行换行*/
    	}
    	.ann_div{
    		border:hidden;
    		height:330px;
    		overflow: auto;
    	}
    </style>
    <div class="row">
	    <div class="col-md-6" style="margin-top:10px;height:330px;">
	    	<!-- 邮箱 -->
	    	<div class="nav-tabs-custom">
		        <ul class="nav nav-tabs pull-right">
		            <li class="active"><a href="#tab_1-1" data-toggle="tab">收件箱</a></li>
		            <li><a href="#tab_2-2" data-toggle="tab">发件箱</a></li>
		            
		            <li class="pull-left header"><i class="glyphicon glyphicon-envelope"></i>邮箱</li>
		        </ul>
		        <div class="tab-content">
		            <div class="tab-pane active" id="tab_1-1">
		                <table class="table table-mailbox">
		                	<thead>
		                		<tr class="unread">
		                			<td>发件人</td>
		                			<td>标题</td>
		                			<td>日期</td>
		                		</tr>
		                	</thead>
							<tbody>
							<c:forEach var="cmessage" items="${cmessageList }">
								<tr class="unread">
									<td class="name edit-message" ref-id="2">
										<a data-toggle="modal" data-target="#compose-modal">
											${cmessage.receivers }
										</a>
									</td>
									<td class="subject edit-message">
										<a href="#">
											${cmessage.title }
										</a>
									</td>
									<td class="time">${cmessage.sendTime }</td>
								</tr>
							</c:forEach>
							</tbody>
						</table>
		            </div><!-- /.tab-pane -->
		            <div class="tab-pane" id="tab_2-2">
		                <table class="table table-mailbox">
		                	<thead>
		                		<tr class="unread">
		                			<td>收件人</td>
		                			<td>标题</td>
		                			<td>日期</td>
		                		</tr>
		                	</thead>
							<tbody>
							<c:forEach var="rmessage" items="${rmessageList }">
								<tr class="unread">
									<td class="name edit-message" ref-id="2">
										<a data-toggle="modal" data-target="#compose-modal">
											${rmessage.creator.name }
										</a>
									</td>
									<td class="subject edit-message">
										<a href="#">
											${rmessage.title }
										</a>
									</td>
									<td class="time">${rmessage.sendTime }</td>
								</tr>
							</c:forEach>
							</tbody>
						</table>
		            </div><!-- /.tab-pane -->
		        </div><!-- /.tab-content -->
		    </div>
	      </div>
	      <div class="col-md-6" style="margin-top:10px;">
		      	<!-- 公告 -->
		   		<div class="box box-info ann_div">
			          <div class="box-header">
			              <i class="fa fa-bullhorn"></i>
			              <h3 class="box-title">公告</h3>
			          </div><!-- /.box-header -->
			          <div class="box-body">
				          	<c:forEach var="anno" items="${requestScope.announcementList}" varStatus="status">
				          		<c:if test="${status.index%2==0 }">
				          			<div class="callout callout-info">
				          		</c:if>
				          		<c:if test="${status.index%2!=0 }">
				          			<div class="callout callout-warning">
				          		</c:if>
					                  <h4>${anno.title}</h4>
					                  <p>部门：${anno.creator.department.name }&nbsp;&nbsp;&nbsp;发出者：${anno.creator.name }</p>
					                  <fmt:formatDate value="${anno.createTime}" var="createTime" pattern="yyyy-MM-dd HH:mm"/>
					                  <p>时间：${createTime }</p>
					                  <p class="omission">${anno.content }</p>
					              </div>
				            </c:forEach>
		        	</div><!-- /.box-body -->
	       	 	</div>
	    	</div>
    	</div>
    	<!-- 日程 -->
    	<div class="row">
    		<div class="col-md-12">
	            <!-- The time line -->
	            <ul class="timeline">
	                <c:if test="${not empty requestScope.scheduleList}">
	                	<!-- timeline time label -->
		                <c:forEach var="schedule" items="${requestScope.scheduleList}">
		                	<!-- timeline time label -->
		                	<li class="time-label">
		                		<fmt:formatDate value="${schedule.startTime}" var="start" pattern="yyyy-MM-dd"/>
			                    <span class="bg-red">
			                        ${start}
			                    </span>
			                </li>
			                <!-- /.timeline-label -->
			                <c:forEach var="activity" items="${schedule.evenList}">
			                	<!-- timeline item -->
				                <li>
				                    <i class="fa fa-flag-o bg-blue"></i>
				                    <div class="timeline-item">
				                    	<fmt:formatDate value="${activity.startTime}" var="shortTime" pattern="HH:mm"/>
				                        <span class="time"><i class="fa fa-clock-o"></i> ${shortTime }</span>
				                        <h3 class="timeline-header">${activity.title}</h3>
				                        <p>发起人：${activity.creator.name}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;所属部门：${activity.creator.department.name }</p>
				                        <div class="timeline-body">
				                            ${activity.description}
				                        </div>
				                    </div>
				                </li>
				                <!-- END timeline item -->
			                </c:forEach>
		                </c:forEach>
	                </c:if>
	                <c:if test="${empty requestScope.scheduleList}">
	                	<li>
	                		<i class="fa fa-flag-o bg-blue"></i>
	                		<div class="timeline-item">
	                			暂无行程
	                		</div>
	                	</li>
	                </c:if>
	                <li>
	                    <i class="fa fa-clock-o"></i>
	                </li>
	            </ul>
       	 	</div><!-- /.col -->
    	</div>